UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c+BfZ9/LObryx9c8/aHwjUlkbXgaqZT6yR7QCP7rKa0=' 
WHERE 
  key_id = '61dc3e818cd1a9d54772693dcd4f5c5398227851de345e03ef7f99c862d0664b' 
  AND (
    token = 'c+BfZ9/LObryx9c8/aHwjUlkbXgaqZT6yR7QCP7rKa0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033