UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RDs8V5OBPgCVv1vO/Gz2ccAHVMteNLwaKKsif+1esFU='
WHERE
key_id = 'ea7fa7013876b7f4871a1548693310effb4eec9dca4d91e55c8d3173ebae713e'
AND (
token = 'RDs8V5OBPgCVv1vO/Gz2ccAHVMteNLwaKKsif+1esFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)