UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ILc2A5DNbnSIXtLiVmDzk9PjR6swcWUBSRSgr62d7Q=' 
WHERE 
  key_id = 'ab2d285e30c57b0b48f34d6e3bca64fe92097063a66448e7b6f624c9cbccd977' 
  AND (
    token = '0ILc2A5DNbnSIXtLiVmDzk9PjR6swcWUBSRSgr62d7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019