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