UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7fC7zqJTABkKu4DOT8yfmB5TUZPLv/rCCiSjMOc5In4=' 
WHERE 
  key_id = '3836dc7f38ac5702396e0c2b9860a9d83c20b18d0cd94459fdbcf75e506e6077' 
  AND (
    token = '7fC7zqJTABkKu4DOT8yfmB5TUZPLv/rCCiSjMOc5In4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024