UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pfj/qK4EUr25ta+n4QO86Cxz6Vd+owHu0MS7BuaTzKQ=' 
WHERE 
  key_id = 'b50c326b9db77afdecb67efdcfaa9f042c1e47a686598e68e49bcffe72866a9d' 
  AND (
    token = 'pfj/qK4EUr25ta+n4QO86Cxz6Vd+owHu0MS7BuaTzKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040