UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HO5m4x95zyfqGiX/k3Ppj4bmFjYrVYmjLpPEC/Awpb0=' 
WHERE 
  key_id = '7c76ca86c4d3bf881d40e68ef9c013f5205a9f8717923ce5424e79e7dae26193' 
  AND (
    token = 'HO5m4x95zyfqGiX/k3Ppj4bmFjYrVYmjLpPEC/Awpb0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040