UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'djEFoEfEYERoMuoSFOOFzVa3KFbI7SvsKfOcscPtDl4='
WHERE
key_id = '3d344d0f1cae0107564b79ef6795bf2941922399e8310cdef1348d356bffbaf8'
AND (
token = 'djEFoEfEYERoMuoSFOOFzVa3KFbI7SvsKfOcscPtDl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)