UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7iY1uNTgTmt5yY7OYAbMyxuoHoOVu4pq7LwD/xwgHAY=' 
WHERE 
  key_id = '9677690dea290af64a0e2107886e9b7eadd1c0e35a2a5a3ede474039047106f0' 
  AND (
    token = '7iY1uNTgTmt5yY7OYAbMyxuoHoOVu4pq7LwD/xwgHAY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030