UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '49AA7PYTGd2xgqgS6qL1Zf62cUqNM709lctRtBmsLnE='
WHERE
key_id = 'f719488a3c4ee89b92489efa109474e6ac3bac5f4f4916aaf75b8a82b89221b9'
AND (
token = '49AA7PYTGd2xgqgS6qL1Zf62cUqNM709lctRtBmsLnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)