UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tHcRSw0c5e/ho6mbDd+fVoRVHx1CMCwVO4wYydQH8h4='
WHERE
key_id = '11d514e0403510d5e7c85fde87f28a80cf3ef304a982d193cf94be8aea586277'
AND (
token = 'tHcRSw0c5e/ho6mbDd+fVoRVHx1CMCwVO4wYydQH8h4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)