UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/MjYSiMVXyKK3YAS8OXMasHc11kCWA2GVPrDFVVZOzk=' 
WHERE 
  key_id = '83011e467f17616479c3532f45c2d47dddee5a00fd4116f53a85c0699e6f5356' 
  AND (
    token = '/MjYSiMVXyKK3YAS8OXMasHc11kCWA2GVPrDFVVZOzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038