UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6A5ltoNiNo5HJ8XW0iuA/6IuZh94AUKlBTyuuxzAcK4='
WHERE
key_id = '42865160785461201c18e68df61044b6133c1cae9e512fc2ab6a140fbbfc35da'
AND (
token = '6A5ltoNiNo5HJ8XW0iuA/6IuZh94AUKlBTyuuxzAcK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)