UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X1mfLCvzntDNi7LY8opOEK7U18b5jSyzS0NPiafBDQk='
WHERE
key_id = '3533a77a30c415f063d80d9dea734c7702cef182d1dd0b54b19d075d592efe72'
AND (
token = 'X1mfLCvzntDNi7LY8opOEK7U18b5jSyzS0NPiafBDQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)