UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ToMTroMVP9ic5EsHtaLSo0maQJtEU2hmzU8Rkt+57BQ='
WHERE
key_id = 'fea8039b282e5edeb77689b729d036a8b8bae963c861a9dbde2537a2563403b6'
AND (
token = 'ToMTroMVP9ic5EsHtaLSo0maQJtEU2hmzU8Rkt+57BQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)