UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zyyZxeXp+27DLp+GVJfb9vhYvFcbeUwKyO4IdxCCd08=' 
WHERE 
  key_id = 'a41a121ae6ce9257f1672242e64b1849927942aa849707ac89d79326dce78fd1' 
  AND (
    token = 'zyyZxeXp+27DLp+GVJfb9vhYvFcbeUwKyO4IdxCCd08=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033