UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EijFdXrLdWh+b/zird0wDZu/siWx+GG5MfAUj91HgVY=' 
WHERE 
  key_id = 'b7545409ebf592a92a4f47d73200a49a40c1277daaf278ad417862a3bd1839a1' 
  AND (
    token = 'EijFdXrLdWh+b/zird0wDZu/siWx+GG5MfAUj91HgVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064