UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'he1oURa5qHA/2uYHyt/XiFnf3ZSSKgcIBdfbn2XqiaU=' 
WHERE 
  key_id = 'f708e556cd69e796928361584f3e465d7ee721edb19d7fc4c620f695fe49dfb7' 
  AND (
    token = 'he1oURa5qHA/2uYHyt/XiFnf3ZSSKgcIBdfbn2XqiaU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022