UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'be2BUVx4vwcq8eIkSOQuO3t34XtX+y4Gnkx29YFNpaQ=' 
WHERE 
  key_id = '43b79d17a4864ad678b03b8baa3e56cf5a37f99ff93b65150e98d1d93943049f' 
  AND (
    token = 'be2BUVx4vwcq8eIkSOQuO3t34XtX+y4Gnkx29YFNpaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036