UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cr92Pi2so2P0v9xh3nxdTgNVLz3ln12rVhFvh18K1PA='
WHERE
key_id = '371b24fb4cb45b1608a3acd91062b756d02680222d3468fb19f4b9fa287a982f'
AND (
token = 'cr92Pi2so2P0v9xh3nxdTgNVLz3ln12rVhFvh18K1PA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)