UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RjugkVhq3EDHG6kTuHKptdeJsL2hNWRCpTYmjmhfFwQ='
WHERE
key_id = 'ed0d92393f9800695b77526bfb451660e56fe6d6bbd5e3400b16015850640172'
AND (
token = 'RjugkVhq3EDHG6kTuHKptdeJsL2hNWRCpTYmjmhfFwQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)