UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7KV8SbP/P1f2+ZwZqzhJp/HdvyXK9VYdX/uA2BRuV98=' 
WHERE 
  key_id = '342164fc4d3ce4893f12c3300916b0ac363d5745f549ecc0ca86c31ada76389c' 
  AND (
    token = '7KV8SbP/P1f2+ZwZqzhJp/HdvyXK9VYdX/uA2BRuV98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037