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

Query time 0.00042