UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '63uy7YfVSAVxNTFrGNpr2s7UAFftDsxmwjL88RbcDp0=' 
WHERE 
  key_id = '6fcdae7e7bf0e8335b336cc184910f982dce782dc0f835117c3513b394abeb94' 
  AND (
    token = '63uy7YfVSAVxNTFrGNpr2s7UAFftDsxmwjL88RbcDp0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034