UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xFe6ByW6nFOseEnRoMOKLqm876v64vxAR009JBW2TiM=' 
WHERE 
  key_id = '35b0b4a3d4c16deb64681b593fed6f3526a5b60f43efb2673ff0eca63a1c59b1' 
  AND (
    token = 'xFe6ByW6nFOseEnRoMOKLqm876v64vxAR009JBW2TiM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059