UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2UsIcStoRtQIYxLly91Fk1VRsIy/iD5nIitQmWXKhZo=' 
WHERE 
  key_id = '910fd320a0db2b17578996904ba9af751e2e19738568c3d3272ce3ace3ceaca4' 
  AND (
    token = '2UsIcStoRtQIYxLly91Fk1VRsIy/iD5nIitQmWXKhZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043