UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g/f/1Mm6nvSUpLlnXSXLyrjCOZsKPmh1UQuET6MhCXg='
WHERE
key_id = 'f97c48bfb0593078e086789740a954da1298f13d1a5ae0dbc9a35840e7ddac07'
AND (
token = 'g/f/1Mm6nvSUpLlnXSXLyrjCOZsKPmh1UQuET6MhCXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)