UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pnPeB/UCVnnBjLP68HrEV2jpeM0/rzpiO8ZEyFgtr5Q=' 
WHERE 
  key_id = 'b31a49e1c33b99e7453ab53f891ad503579808b41b61c7de0c4cb272a1f0e8c4' 
  AND (
    token = 'pnPeB/UCVnnBjLP68HrEV2jpeM0/rzpiO8ZEyFgtr5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037