UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nNkeyxGbWSUkCaGEGPg0B10i4riE/9sdIaekwDjgf94='
WHERE
key_id = '6985088438fda5430e1d2576fe5de3172233eeab62bdf8a8673a4fdff893396f'
AND (
token = 'nNkeyxGbWSUkCaGEGPg0B10i4riE/9sdIaekwDjgf94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)