UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I7Fi9TJxXvH2D5xAAWrvDFtVDWhqLw9Q/rCTj3fkqqg=' 
WHERE 
  key_id = '6c8b088f5605414e0dedf7ed549bd805c23205a7b3f75adf6708c97cf0ce0465' 
  AND (
    token = 'I7Fi9TJxXvH2D5xAAWrvDFtVDWhqLw9Q/rCTj3fkqqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014