UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NrfHuZQn/vIQFXydagmxuD40fn7cxmcacJSxSZPIFiI=' 
WHERE 
  key_id = '4a2de5edd1e9b91c82ff2bcde3d1bd85a4dc93bebb7d1864845d55012ae9fdd7' 
  AND (
    token = 'NrfHuZQn/vIQFXydagmxuD40fn7cxmcacJSxSZPIFiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042