UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7TeFShXeidstx3kfKBHoVLJkxgIC1YbnwvHToVZ/V1I='
WHERE
key_id = 'cad01d232b2dc9b17b61170e25c57a65472aa0d7b19bd5125efe2ea960b92283'
AND (
token = '7TeFShXeidstx3kfKBHoVLJkxgIC1YbnwvHToVZ/V1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)