UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L44S2JUW8ZA7ndB+S7kVouriDa6hdbEnaoUKV99Ok5o='
WHERE
key_id = 'eb9cc5a442c7b0ed900ee7c6ccd4e28a57c3568939493fd370977a507b6dc8e3'
AND (
token = 'L44S2JUW8ZA7ndB+S7kVouriDa6hdbEnaoUKV99Ok5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)