UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zgJmumDhTJ/E8pRlukLgYwnToR2PZ4YGveDWoX4B/s4=' 
WHERE 
  key_id = '93d5da6e3d3cedf6bd54fed39388acad4b9d4d464bfc5c9e93f86c28d83121ed' 
  AND (
    token = 'zgJmumDhTJ/E8pRlukLgYwnToR2PZ4YGveDWoX4B/s4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036