UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cekf32l7kJb1APNPAbRq2rU7tBdUOR48BEqOoKDxjp8='
WHERE
key_id = '0805040a9828c09103ebe7f0d932d69fd4e05e56f865cc1c9536c67d81ec3830'
AND (
token = 'Cekf32l7kJb1APNPAbRq2rU7tBdUOR48BEqOoKDxjp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)