UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MFdrUCXmwz+cF2NbqKC1L8XR3hBY++4d2YhzdZDUUFo='
WHERE
key_id = 'f0c7971a94746b10acd9ead08984b233e8247fb9bb77a3dfc500f031502f268f'
AND (
token = 'MFdrUCXmwz+cF2NbqKC1L8XR3hBY++4d2YhzdZDUUFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)