UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bXKd3lKQGyRCieDtKodDbM23XpFz6Q2Hgm+OaWipuVY=' 
WHERE 
  key_id = '7193e46f2cca90c285ced732759cedbe91c353e1011fc2d637f9cb5f5f83cad8' 
  AND (
    token = 'bXKd3lKQGyRCieDtKodDbM23XpFz6Q2Hgm+OaWipuVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047